package com.sw.listener;

import org.springframework.core.Ordered;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @program: monitor2
 * @description: 启动页面重定向
 * @author: Wangzheng
 * @create: 2020-12-26 15:22
 **/

public class WebConfigurer implements WebMvcConfigurer {
	@Override
	public void addViewControllers(ViewControllerRegistry registry) {

		//默认地址（可以是页面或后台请求接口）
		registry.addViewController("/").setViewName("forward:/index.html");
		//设置过滤优先级最高
		registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
	}
}